home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr52 / 5333de.zip / 6.PRG < prev    next >
Text File  |  1993-04-03  |  922b  |  38 lines

  1. // Update the client files CA of the Pears
  2. // This variation takes APPEND out of the loop.
  3. // and it takes the CA.dbf out completely.
  4. // and changes all the private variables to local
  5. // and avoids multiple file re-opens.
  6.  
  7. local I
  8. clear
  9.  
  10. use IDS NEW
  11. FOR I = 1 TO 6000
  12.    X = NEW_ID("CA")
  13.    ? "REC#"+str(I,4)+"   "
  14.    ?? "string= "+str(memory(0),4)+"K  "+;
  15.                 "free  = "+str(memory(1),4)+"K  "+;
  16.                 "run   = "+str(memory(2),4)+"K  "+;
  17.                 "EMM   = "+str(memory(3),4)+"K  "
  18. next
  19. use
  20. return
  21.  
  22. Function NEW_ID(P1)
  23. ***************************************
  24. *
  25. ***************************************
  26. local   R,;   && returns the latest ID
  27.           W,;  && saves the previous workarea chosen
  28.           D
  29.  
  30. locate for DS == PadR(P1, 8)
  31. if found()
  32.       D = val(NEWID)+1
  33.       R := PadL( D, len(trim(NEWID)), "0")
  34.       replace NEWID with R
  35. endif
  36. return R
  37.  
  38.